﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IRemoting;

namespace QLNH_SERVER
{
    public class RemoteObject : MarshalByRefObject, IRemote
    {
        public void RegistryTransportProxy(string user, TransportProxy tp)
        {
            Program.mainForm.AddOnlineUser(user, tp);   
        }

        public void SendValuePrivate(HEADER header, object msg)
        {
        }

        public bool Login(string username)
        {
            if (Program.mainForm.IsExist(username))
                return false;
            return true;
        }

        public void Logout(string username)
        {
            if (Program.mainForm.IsExist(username))
                Program.mainForm.RemoveOnlineUser(username);
        }

    }
}
